package com.fesine.ch02.synchronizedBlockLockAll.test3;


/**
 * @description: 类描述
 * @author: Fesine
 * @createTime:2016/7/5 16:33
 * @update:修改内容
 * @author: Fesine
 * @updateTime:2016/7/5 16:33
 */
public class Service {
    public void testMethod1(MyObject object) {
        synchronized (object) {
            try {
                System.out.println("testMethod1 __getLock time=" + System.currentTimeMillis()
                        + " run ThreadName=" + Thread.currentThread().getName());
                Thread.sleep(5000);
                System.out.println("testMethod1 __releaseLock time=" + System.currentTimeMillis()
                        + " run ThreadName=" + Thread.currentThread().getName());
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
